package com.school.springboot_login.dao;


import com.school.springboot_login.bean.LoginLog;
import com.school.springboot_login.bean.LoginLog_redis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.Date;

/*
* 对登录日志进行插入操作
* */
@Repository
public class LoginLogDao_redis {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public void insertLoginLog(String name) {
        String sqlStr = "INSERT INTO loginlog_redis(user_name,ip,login_datetime) "
                + "VALUES(?,?,?)";
        Object[] args = {name,"192.168.0.1",new Date()};
        jdbcTemplate.update(sqlStr, args);
    }
}
